package com.fengfeng.view.dialog;

import android.app.Activity;
import android.app.Dialog;
import android.content.Context;
import android.os.Bundle;
import android.view.View;
import android.widget.TextView;

import androidx.annotation.NonNull;

import com.fengfeng.sdk.R;

public class ExitDialog extends Dialog {

    private TextView positiveBtn, negativeButton;
    Activity mActivity;

    public ExitDialog(@NonNull Context context) {
        super(context, R.style.CustomDialog);
    }

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.exit_dialog_layout);
        setCanceledOnTouchOutside(false);
        initView();
        initEvent();
    }


    private void initView() {
        positiveBtn = findViewById(R.id.textView3);
        negativeButton = findViewById(R.id.textView2);
    }

    private void initEvent() {
        positiveBtn.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                mActivity.finish();
            }
        });
        negativeButton.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                cancel();
            }
        });
    }


    @Override
    public void show() {
        super.show();
    }
}
